package mfpc.connection;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class ConnectionFactory {

	private static  EntityManagerFactory emf =  null;
	
	public static EntityManager getConnection(){
		
		if(emf==null){
			 emf =  Persistence.createEntityManagerFactory("MyConnection");
		}
		
		return emf.createEntityManager();
		
	}
	
	
}
